/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.capex.javaee.applets;

import java.applet.*;
import java.awt.*;
import java.net.*;

public class soundapplet extends Applet {

    AudioClip clip;
    Image image;

    @Override
    public void init() {
        URL imageurl = null;
        URL sound = null;


        try {
            imageurl = new URL(getCodeBase(), "avg.jpg");
            sound = new URL(getCodeBase(), "sound.au");
        } catch (MalformedURLException e) {
        }
        image = getImage(imageurl);
        clip = getAudioClip(sound);
        clip.play();
        clip.loop();
    }

    public void paint(Graphics g) {
        g.drawImage(image, 0, 0, getSize().width, getSize().height, this);
    }
}
